package com.gt.web.controller.app;

import com.gt.admin.domain.EsCheckFlow;
import com.gt.app.domain.EsTreatFlowList;
import com.gt.app.domain.dto.EsCheckFlowDto;
import com.gt.app.domain.dto.EsOperationAfterInfoDto;
import com.gt.app.domain.dto.EsTreatInfoDto;
import com.gt.app.service.EsCheckFlowService;
import com.gt.app.service.EsOperationAfterInfoService;
import com.gt.app.service.EsTreatFlowListService;
import com.gt.app.service.EsTreatInfoService;
import com.gt.common.core.domain.AjaxResult;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("checkFollot")
@Api(tags = "结肠癌筛查检查随访")
public class CheckFollowController {

    @Autowired
    private EsOperationAfterInfoService esOperationAfterInfoService;

    @Autowired
    private EsTreatInfoService esTreatInfoService;

    @Autowired
    private EsTreatFlowListService esTreatFlowListService;

    @Autowired
    private EsCheckFlowService esCheckFlowService;

    @ApiOperation(value = "根据checkId查询术后1天")
    @GetMapping(value = "getOneDayById")
    public AjaxResult getOneDayById(String checkId,String type){
        List<EsOperationAfterInfoDto> operationAfterInfoDtoList = esOperationAfterInfoService.getOneDayById(checkId,type);
        return AjaxResult.success(operationAfterInfoDtoList);
    }

    @ApiOperation(value = "根据checkId查询治疗信息")
    @GetMapping(value = "getTreatInfoById")
    public AjaxResult getTreatInfoById(String checkId){
        List<EsTreatInfoDto> treatInfoDtoList = esTreatInfoService.getTreatInfoById(checkId);
        return AjaxResult.success(treatInfoDtoList);
    }

    @ApiOperation(value = "根据checkId查询随访报告列表")
    @GetMapping(value = "getTreatInfoFlow")
    public AjaxResult getTreatInfoFlow(String checkId){
        List<EsTreatFlowList> treatFlowLists = esTreatFlowListService.esTreatFlowListService(checkId);
        return AjaxResult.success(treatFlowLists);
    }

    @ApiOperation(value = "根据checkId查询检查随访")
    @GetMapping(value = "getCheckFlow")
    public AjaxResult getCheckFlow(String checkId){
        List<EsCheckFlowDto> checkFlows =  esCheckFlowService.getCheckFlow(checkId);
        return AjaxResult.success(checkFlows);
    }

}
